package br.com.opengti.webforum.ws.domain.impl;

import java.util.Calendar;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import br.com.opengti.webforum.ws.infra.dao.WebForumDomainSupport;

/**
 * @author Felipe Balbino <felipe@opengti.com.br>
 * @author Gabriel Cardelli <cardelli@opengti.com.br>
 */
@Entity
public class Topico {
	
	@Transient private WebForumDomainSupport webForumDomainSupport;
	
	@Id
	@GeneratedValue
	private Long id;
	
	@Enumerated(EnumType.STRING)
	private Status status;
	
	@ManyToOne
	private Usuario usuario;
	
	@ManyToMany
	private List<Usuario> seguidores;
	
	@OneToMany(mappedBy="topico")
	private List<Resposta> respostas;
	
	private String title;
	
	private String corpo;
	
	@Temporal(TemporalType.TIMESTAMP)
	private Calendar dataCriacao;
	
	@ManyToMany
	private List<Tag> tags;
	
	private Long views;
	
}
